#include "Rect.h"

namespace DinoUI
{
	Rect::Rect(int x, int y, int w, int h)
	{
		m_x = x;
		m_y = y;
		m_width = w;
		m_height = h;
	}

	Rect::Rect(void)
	{
		m_x = 0;
		m_y = 0;
		m_width = 0;
		m_height = 0;
	}

	Rect::~Rect(void)
	{
	}

	void Rect::SetSize(int w, int h) { m_width = w; m_height = h; }
	void Rect::SetHeight(int h) { m_height = h; }
	void Rect::SetWidth(int w) { m_width = w; }
	int Rect::GetWidth() { return m_width; }
	int Rect::GetHeight() {	return m_height; }

	void Rect::SetPosition(int x, int y) { m_x = x; m_y = y; }
	int Rect::GetX() { return m_x; }
	int Rect::GetY() { return m_y; }
	void Rect::SetX(int x) { m_x = x; }
	void Rect::SetY(int y) { m_y = y; }

	bool Rect::IsPointInside(int x, int y)
	{
		if( (x >= m_x && x <= m_x + m_width)  &&  (y >= m_y && y <= m_y + m_height))
			return true;
		else
			return false;
	}
}

